package dao;

import java.util.HashMap;
import java.util.Set;

/**
 * Interface TokenDao
 * 
 * Class using this interface must implement the methods in this interface. This
 * class contains methods to perform dao operations related to token table in the database
 * @author Sukhjinder K. Narula
 * @since June 2013
 * @version $Revision: 1.0 $
 */
public interface TokenDao {
	
		/**
	     * Creates a new token and returns the id
	     * @param properties 
	    
	     * @return int
		 * @throws DaoException
		 * @throws ModelException  */
	    public int create(HashMap<String, String> properties) throws DaoException;
	   
	    /**
	     * Loads a token row given id
	    
	    
	    
	     * @param Id int
	     * @return properties * @throws DaoException
	     * @throws ModelException  */
	    public HashMap<String, String> load(int Id) throws DaoException;
	    
	    /**
	     * Updates a token
	     * @param properties
	    
	     * @throws DaoException
	     * @throws ModelException  */
	    public void update(HashMap<String, String> properties) throws DaoException;
	   
	    /**
		 * Deletes a user row, given the id
		
		
		 * @param Id int
	     * @throws DaoException
	     * @throws ModelException  */
		public void delete(int Id) throws DaoException;
		
		/**
		 * Given the userId, returns all the tokens
		 * @param userId
		
		
		 * @return HashMap * @throws DaoException */
		public HashMap<Integer, String[]> findByUserId(int userId) throws DaoException;
		
		/**
		 * Given a user id, delete all the tokens
		 * @param userId
		
		 * @throws DaoException
		 * @throws ModelException  */
		public void deleteByUserId(int userId) throws DaoException;	
		
		/**
		 * Given a set of token ids, delete all the tokens
		
		
		 * @param tokenIds Set<Integer>
		 * @throws DaoException
		 * @throws ModelException  */
		public void deleteByTokenIds(Set<Integer> tokenIds) throws DaoException;	
}
